import React from "react"

export default function test2() {

    const a = [1, 2, 3, 4, 5]
    const b = [3, 4, 5, 6, 7]
    const temp = []
    function filters(a, b) {
        // console.log(a, b)
        a.forEach(item => {
            if (!b.some(i => i === item)) {
                temp.push(item)
            }
        })
        b.forEach(item => {
            if (!a.some(i => i === item)) {
                temp.push(item)
            }
        })
        console.log(temp)
    }

    function filters2(a, b) {
        // 代码实现
        const m = new Map
        const arr = [...a, ...b]
        const res = []
        for (let i = 0; i < arr.length; i++) {
            const val = arr[i]
            let num = m.get(val) || 0
            m.set(val, num + 1)
        }
        m.forEach((k, v) => {
            if (k === 1) {
                res.push(v)
            }
        })
        return res
    }

    filters2(a, b)

    const _version = ['1.45.0', '1.5', '6', '3.3.3.3.3.3.3']

    function versionSort(arr) {


    }

    versionSort(_version)


    return (
        <>
            <div class="client-a">
                <div class="client-b">1</div>
                <div class="client-b">2</div>
                <div class="client-b">3</div>
                <div class="client-b">4</div>
                <div class="client-b">5</div>
            </div>
        </>
    )
}